import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import Layout from '@/views/layout/Layout'

export const constantRouterMap = [
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path*',
        component: () => import('@/views/redirect/index')
      }
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },
  {
    path: '/auth-redirect',
    component: () => import('@/views/login/authredirect'),
    hidden: true
  },
  {
    path: '/error/404',
    component: Layout,
    hidden: true,
    redirect: '/404',
    children: [
      {
        path: '/404',
        component: () => import('@/views/errorPage/404')
      }
    ]
  },
  {
    path: '/error/401',
    component: Layout,
    hidden: true,
    redirect: '/401',
    children: [
      {
        path: '/401',
        component: () => import('@/views/errorPage/401')
      }
    ]
  },
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: () => import('@/views/dashboard/index'),
        name: 'Dashboard',
        meta: { title: '首页', icon: 'el-icon-s-home', noCache: true }
      }
    ]
  }
]

export const zhongkongRouterMap = [
  {
    path: '/zhongkong',
    component: Layout,
    name:'ZCRecruit',
    meta:{title:'招聘', icon:'el-icon-s-promotion'},
    redirect: '/zhongkong/index',
    children: [
      {
        path: '/zhongkong/index',
        component: () => import('@/rec_views/zhongkong/index'),
        name: 'ZCRecruitGuide',
        hidden:true,
        meta: { title: '招聘索引',noCache: true }
      },
      {
        path: '/zhongkong/job/import',
        component: () => import('@/rec_views/zhongkong/import'),
        name: 'ZCExcelImport',
        meta: { title: '导入Excel',noCache: true }
      },
      {
        path: '/zhongkong/job/list',
        component: () => import('@/rec_views/zhongkong/list'),
        name: 'ZCJobList',
        meta: { title: '职位管理',noCache: true }
      },
      {
        path: '/zhongkong/job/list/:id',
        component: () => import('@/rec_views/zhongkong/detail'),
        hidden:true,
        name: 'ZCJobDetail',
        meta: { title: '岗位招聘详情',noCache: true }
      },
        {
            path: '/zhongkong/job/edit',
            component: () => import('@/rec_views/zhongkong/edit'),
            hidden:true,
            name: 'ZCJobEdit',
            meta: { title: '修改岗位详情',noCache: true }
        }
    ]
  }
]
export const ibmRouterMap = [
  {
    path: '/ibm',
    component: Layout,
    name:'IBMRecruit',
    meta:{title:'招聘', icon:'el-icon-s-promotion'},
    redirect: '/ibm/index',
    children: [
      {
        path: '/ibm/index',
        component: () => import('@/rec_views/ibm/index'),
        name: 'IBMRecruitGuide',
        hidden:true,
        meta: { title: '招聘索引',noCache: true }
      },
      {
        path: '/ibm/job/import',
        component: () => import('@/rec_views/ibm/import'),
        name: 'IBMExcelImport',
        meta: { title: '导入Excel',noCache: true }
      },
      {
        path: '/ibm/job/list',
        component: () => import('@/rec_views/ibm/list'),
        name: 'IBMJobList',
        meta: { title: '职位管理',noCache: true }
      },
      {
        path: '/ibm/job/list/:id',
        component: () => import('@/rec_views/ibm/detail'),
        hidden:true,
        name: 'IBMJobDetail',
        meta: { title: '岗位招聘详情',noCache: true }
      },
      {
         path: '/ibm/job/update',
         component: () => import('@/rec_views/ibm/edit'),
         hidden:true,
         name: 'IBMJobUpdate',
         meta: { title: '修改岗位详情',noCache: true }
      }
    ]
  }
]
export const mengniuRouterMap = [
  {
    path: '/mengniu',
    component: Layout,
    name:'MengNiuRecruit',
    meta:{title:'招聘', icon:'el-icon-s-promotion'},
    redirect: '/mengniu/index',
    children: [
      {
        path: '/mengniu/index',
        component: () => import('@/rec_views/mengniu/index'),
        name: 'MengNiuRecruitGuide',
        hidden:true,
        meta: { title: '招聘索引',noCache: true }
      },
      {
        path: '/mengniu/job/import',
        component: () => import('@/rec_views/mengniu/import'),
        name: 'MengNiuExcelImport',
        meta: { title: '导入Excel',noCache: true }
      },
      {
        path: '/mengniu/job/list',
        component: () => import('@/rec_views/mengniu/list'),
        name: 'MengNiuJobList',
        meta: { title: '职位管理',noCache: true }
      },
      {
        path: '/mengniu/job/list/:id',
        component: () => import('@/rec_views/mengniu/detail'),
        hidden:true,
        name: 'MengNiuJobDetail',
        meta: { title: '岗位招聘详情',noCache: true }
      },
        {
            path: '/mengniu/job/edit',
            component: () => import('@/rec_views/mengniu/edit'),
            hidden:true,
            name: 'MengNiuJobEdit',
            meta: { title: '修改岗位详情',noCache: true }
        }
    ]
  }
]
export const xiaoRouterMap = [
    {
        path: '/xiao',
        component: Layout,
        name:'XiAoRecruit',
        meta:{title:'招聘', icon:'el-icon-s-promotion'},
        redirect: '/xiao/index',
        children: [
            {
                path: '/xiao/index',
                component: () => import('@/rec_views/xiao/index'),
                name: 'XiAoRecruitGuide',
                hidden:true,
                meta: { title: '招聘索引',noCache: true }
            },
            {
                path: '/xiao/job/import',
                component: () => import('@/rec_views/xiao/import'),
                name: 'XiAoExcelImport',
                meta: { title: '导入Excel',noCache: true }
            },
            {
                path: '/xiao/job/list',
                component: () => import('@/rec_views/xiao/list'),
                name: 'XiAoJobList',
                meta: { title: '职位管理',noCache: true }
            },
            {
                path: '/xiao/job/list/:id',
                component: () => import('@/rec_views/xiao/detail'),
                hidden:true,
                name: 'XiAoJobDetail',
                meta: { title: '岗位招聘详情',noCache: true }
            },
            {
                path: '/xiao/job/edit/:id',
                component: () => import('@/rec_views/xiao/edit'),
                hidden:true,
                name: 'XiAoJobEdit',
                meta: { title: '修改岗位详情',noCache: true }
            }
        ]
    }
]
export const nengyuanRouterMap = [
    {
        path: '/nengyuan',
        component: Layout,
        name:'NengYuanRecruit',
        meta:{title:'招聘', icon:'el-icon-s-promotion'},
        redirect: '/nengyuan/index',
        children: [
            {
                path: '/nengyuan/index',
                component: () => import('@/rec_views/nengyuan/index'),
                name: 'NengYuanRecruitGuide',
                hidden:true,
                meta: { title: '招聘索引',noCache: true }
            },
            {
                path: '/nengyuan/job/import',
                component: () => import('@/rec_views/nengyuan/import'),
                name: 'NengYuanExcelImport',
                meta: { title: '导入Excel',noCache: true }
            },
            {
                path: '/nengyuan/job/list',
                component: () => import('@/rec_views/nengyuan/list'),
                name: 'NengYuanJobList',
                meta: { title: '职位管理',noCache: true }
            },
            {
                path: '/nengyuan/job/list/:id',
                component: () => import('@/rec_views/nengyuan/detail'),
                hidden:true,
                name: 'NengYuanJobDetail',
                meta: { title: '岗位招聘详情',noCache: true }
            },
            {
                path: '/nengyuan/job/edit/:id',
                component: () => import('@/rec_views/nengyuan/edit'),
                hidden:true,
                name: 'NengYuanJobEdit',
                meta: { title: '修改岗位详情',noCache: true }
            }
        ]
    }
];
export const taidajiansheRouterMap = [
    {
        path: '/taidajianshe',
        component: Layout,
        name:'TaiDaJianSheRecruit',
        meta:{title:'招聘', icon:'el-icon-s-promotion'},
        redirect: '/taidajianshe/index',
        children: [
            {
                path: '/taidajianshe/index',
                component: () => import('@/rec_views/taidajianshe/index'),
                name: 'TaiDaJianSheRecruitGuide',
                hidden:true,
                meta: { title: '招聘索引',noCache: true }
            },
            {
                path: '/taidajianshe/job/import',
                component: () => import('@/rec_views/taidajianshe/import'),
                name: 'TaiDaJianSheExcelImport',
                meta: { title: '导入Excel',noCache: true }
            },
            {
                path: '/taidajianshe/job/list',
                component: () => import('@/rec_views/taidajianshe/list'),
                name: 'TaiDaJianSheJobList',
                meta: { title: '职位管理',noCache: true }
            },
            {
                path: '/taidajianshe/job/list/:id',
                component: () => import('@/rec_views/taidajianshe/detail'),
                hidden:true,
                name: 'TaiDaJianSheJobDetail',
                meta: { title: '岗位招聘详情',noCache: true }
            }
        ]
    }
];
export const bmwRouterMap = [
    {
        path: '/bmw',
        component: Layout,
        name:'BMWRecruit',
        meta:{title:'招聘', icon:'el-icon-s-promotion'},
        redirect: '/bmw/index',
        children: [
            {
                path: '/bmw/index',
                component: () => import('@/rec_views/bmw/index'),
                name: 'BMWRecruitGuide',
                hidden:true,
                meta: { title: '招聘索引',noCache: true }
            },
            {
                path: '/bmw/student/list',
                component: () => import('@/rec_views/bmw/studentList'),
                name: 'BMWStudentList',
                meta: { title: '报名管理',noCache: true }
            },
            {
                path: '/bmw/scene/list',
                component: () => import('@/rec_views/bmw/sceneList'),
                name: 'BMWSceneList',
                meta: { title: '场次列表',noCache: true }
            },
            {
                path: '/bmw/scene/form',
                component: () => import('@/rec_views/bmw/sceneForm'),
                name: 'BMWSceneForm',
                hidden: true,
                meta: { title: '场次管理',noCache: true }
            }
        ]
    }
];
export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  // base:__dirname,
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
})